let pagesConfig = require('./page.config.js');

module.exports = {
    publicPath: process.env.NODE_ENV === 'production' ? '/dist/' : '/',
    outputDir: process.env.outputDir,
    productionSourceMap: false,
    pages: pagesConfig,
    devServer: {
        open: true,
        index: '/home.html'
    },
    chainWebpack: config => {
        config.module
            .rule("images")
            .use("image-webpack-loader")
            .loader("image-webpack-loader")
            .options({
                mozjpeg: { progressive: true, quality: 65 },
                optipng: { enabled: false },
                pngquant: { quality: "65-90", speed: 4 },
                gifsicle: { interlaced: false },
                webp: { quality: 75 }
            });
    }
}

